<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="TestCase,reflexunit.framework.TestCase,asynchronousAssertions,asynchronousAssertionsCount,addAsync,fail,resetStaticTestVars,setupTest,tearDownTest" name="keywords">
<title>reflexunit.framework.TestCase</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'TestCase - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?reflexunit/framework/TestCase.html&amp;reflexunit/framework/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;TestCase</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class TestCase"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">reflexunit.framework</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class TestCase</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">TestCase <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="Assert.html">Assert</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implements</td><td><a href="ITestCase.html">ITestCase</a></td>
</tr>
</table>
<p></p>
  Classes defining testable methods may extend this class for convenience but are not required to do so.
  
  <p>Since <code>TestCase</code> extends <code>Assert</code> it automatically provides access to all of the related assertion methods.
  This calss also defines a method for testing asynchronous code (see <code>addAsync</code> for more).</p>
  
  <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../framework/Assert.html" target="">reflexunit.framework.Assert</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProperty" id="hideInheritedProperty">
<a onclick="javascript:setInheritedVisible(false,'Property');" href="#propertySummary" class="showHideLink"><img src="../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Properties</a>
</div>
<div class="showInheritedProperty" id="showInheritedProperty">
<a onclick="javascript:setInheritedVisible(true,'Property');" href="#propertySummary" class="showHideLink"><img src="../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Properties</a>
</div>
</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#asynchronousAssertions">asynchronousAssertions</a> : Array<div class="summaryTableDescription">[static][read-only]
   Returns an <code>AsyncronousAssertion</code> representing each call to <code>addAsync</code> made by the previous executed test method.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#asynchronousAssertionsCount">asynchronousAssertionsCount</a> : int<div class="summaryTableDescription">[static][read-only]
   Convenience method.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="Assert.html#numAsserts">numAsserts</a> : int<div class="summaryTableDescription">[static]
   Number of assertions made by the most recently executed test method.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<div class="showHideLinks">
<div class="hideInheritedMethod" id="hideInheritedMethod">
<a onclick="javascript:setInheritedVisible(false,'Method');" href="#methodSummary" class="showHideLink"><img src="../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Methods</a>
</div>
<div class="showInheritedMethod" id="showInheritedMethod">
<a onclick="javascript:setInheritedVisible(true,'Method');" href="#methodSummary" class="showHideLink"><img src="../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Methods</a>
</div>
</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#TestCase()">TestCase</a>()</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addAsync()">addAsync</a>(eventHandler:Function, timeout:int = 1000, failureMessageFunction:Function = null, failureMessageFunctionArgs:Array = null, failureThisObject:* = null):Function</div>
<div class="summaryTableDescription">[static]
   Add an asynchronous check point to the test.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertEquals()">assertEquals</a>(expected:*, actual:String, message:* = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that two values are equal.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertFalse()">assertFalse</a>(expression:*, message:String = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that the value specified is FALSE.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertNotEquals()">assertNotEquals</a>(expected:*, actual:String, message:* = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that the two values specified are not equal.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertNotNull()">assertNotNull</a>(expression:*, message:String = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that the value specified is not NULL.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertNull()">assertNull</a>(expression:*, message:String = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that the value specified is NULL.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#assertTrue()">assertTrue</a>(expression:*, message:String = null):void</div>
<div class="summaryTableDescription">[static]
   Asserts that the value specified is TRUE.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="hideInheritedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Assert.html#resetNumAsserts()">resetNumAsserts</a>():void</div>
<div class="summaryTableDescription">[static]
   Resets the value of <code>numAsserts</code>.</div>
</td><td class="summaryTableOwnerCol"><a href="Assert.html">Assert</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#resetStaticTestVars()">resetStaticTestVars</a>():void</div>
<div class="summaryTableDescription">[static]
   Resets the value stored in <code>numAsyncAssertions</code> as well as the value returned by <code>asyncAssertion.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setupTest()">setupTest</a>():void</div>
<div class="summaryTableDescription">
   
   Called before each testable method is run.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#tearDownTest()">tearDownTest</a>():void</div>
<div class="summaryTableDescription">
   
   Called after each testable method has run and all asserts have completed.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#fail()">fail</a>(message:String = null):void</div>
<div class="summaryTableDescription">
   Causes the current test to intentionally fail with an optional message.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="asynchronousAssertions"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">asynchronousAssertions</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>asynchronousAssertions:Array</code>&nbsp;&nbsp;[read-only]<p>
   Returns an <code>AsyncronousAssertion</code> representing each call to <code>addAsync</code> made by the previous executed test method.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get asynchronousAssertions():Array</code>
<br>
</div>
<a name="asynchronousAssertionsCount"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">asynchronousAssertionsCount</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>asynchronousAssertionsCount:int</code>&nbsp;&nbsp;[read-only]<p>
   Convenience method.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get asynchronousAssertionsCount():int</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="TestCase()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TestCase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function TestCase()</code>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addAsync()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addAsync</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addAsync(eventHandler:Function, timeout:int = 1000, failureMessageFunction:Function = null, failureMessageFunctionArgs:Array = null, failureThisObject:* = null):Function</code><p>
   Add an asynchronous check point to the test.
   This method will return an event handler function.
   
   </p><p>An example of using this method is as follows:</p>
   <p><code>
   var timer:Timer = new Timer( 100, 1 );
   timer.addEventListener( TimerEvent.TIMER_COMPLETE, addAsync( function( event:TimerEvent ):void {}, 10 ) );
   timer.start();
   </code></p>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">eventHandler</span>:Function</code> &mdash; The Function to execute once the related event has successfully occurred
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeout</span>:int</code> (default = <code>1000</code>)<code></code> &mdash; The maximum allowable time (in ms) the event may not fire before it is considered a failure
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">failureMessageFunction</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; Optional method to provide a custom error message in the event of a failure
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">failureMessageFunctionArgs</span>:Array</code> (default = <code>null</code>)<code></code> &mdash; Optional argumetns to pass to the failureMessageFunction
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">failureThisObject</span>:*</code> (default = <code>null</code>)<code></code> &mdash; Optional scope to execute failureMessageFunction within
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Function</code></td>
</tr>
</table>
</div>
<a name="fail()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">fail</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected final function fail(message:String = null):void</code><p>
   Causes the current test to intentionally fail with an optional message.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">message</span>:String</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
</div>
<a name="resetStaticTestVars()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">resetStaticTestVars</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function resetStaticTestVars():void</code><p>
   Resets the value stored in <code>numAsyncAssertions</code> as well as the value returned by <code>asyncAssertion.
   This method should be explicitly called before each test method is run.
   </p></div>
<a name="setupTest()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setupTest</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setupTest():void</code><p>
   
   Called before each testable method is run.
   This method is responsible for initializing all common, pre-test settings.
   </p></div>
<a name="tearDownTest()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">tearDownTest</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function tearDownTest():void</code><p>
   
   Called after each testable method has run and all asserts have completed.
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
